{include file="public/header" /}
<title></title>
		<link rel="stylesheet" href="__AGENT__/css/qianyue.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<style type="text/css">
			#sfz_pic{position: relative;}/*opacity: 0;*/
			 .upload,.upload1{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#dp_pic{position: relative;}
			 .upload2{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#yyzz_pic{position: relative;}
			 .upload3{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			#qt_pic{position: relative;}
			 .upload4{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			
		</style> 
</head>

<body>
	<article class="page-container">
		<form class="form form-horizontal" id="form-admin-add" method="post">

			<div class="row cl">
				<input type="text" value="{$id}" id="id" name="id" style="display: none;">
				<input type="text" value="{$type}" id="type" name="type" style="display: none;">
				<input type="text" value="{$usertype}" id="usertype" name="usertype" style="display: none;">
				<div class="shxx_row clearfix">
		            <div class="left">处理备注</div>
		            <div class="right">
		                <div class="htrig_box">
		                	<div class="htrig_con">
		                		<textarea name="content" id="remark" class="textarea"></textarea>
		                	</div>
		                </div>
		            </div>
		            <div class="left">凭证截图</div>
		            <div class="renz_img " id="yyzz_pic" style="margin-left: 120px;">
    				<input type="hidden" name="logo" id="thumb_1"  value=""/>
    				<input type="file" id="upload_1" class="upload1" value="选择图片文件" multiple />
					<span><img class='img_1' id='img_1' id='img_1' style="width: 150px;height: 150px;" src="__PUBLIC__/static/logo/1/logomr.png"></span>
    			</div>
		       </div>
			</div>

			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius" id='tijiao' type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</article>
	<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
	{include file="public/footer" /}
	<script type="text/javascript">
	layui.use(['form','upload'], function(){
  		var $ = layui.jquery,upload = layui.upload,form = layui.form;
  		
  		var uploadInst_1 = upload.render({
			elem: '#upload_1'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_1').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('admin/sys/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_1').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('agent/index/upload')}"
		    ,accept:'images'
		});
	});
	
$('#tijiao').click(function(){
		$.ajax({
				type: 'post',
				data:{
					id			:$('#id').val(),
					type		:$('#type').val(),
					thumb		:$("#thumb_1").val(),
					usertype	:$('#usertype').val(),
					content		:$('#remark').val()
				},
				url: "{:url('sys/user_tx_result')}" ,
				success: function(data){
					if(data.code == 200) {
						layer.msg(data.msg, {
							icon: 1,
							time: 1000
						}, function() {
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name);
							parent.layer.close(index);
						});
					} else {
						layer.msg(data.msg, {
							icon: 1,
							time: 1000
						});
					}
					
				},
                error: function(XmlHttpRequest, textStatus, errorThrown){
					layer.msg('失败!',{icon:1,time:1000});
				}
			});
	});
	
</script>